<html>
<head><meta charset="utf-8"><title>auto trait tuples · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/auto.20trait.20tuples.html">auto trait tuples</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211992011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/auto%20trait%20tuples/near/211992011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/auto.20trait.20tuples.html#211992011">(Oct 02 2020 at 00:22)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I was thinking that with respect to the auto-trait issue, it'd be better to write <code>constituent_types_for_ty</code> so that it <em>always</em> returns the tuple type, and not the way you had it, where it sometimes did and sometimes didn't. it'll be harder to debug problems that way I imagine.</p>



<a name="211993161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/auto%20trait%20tuples/near/211993161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/auto.20trait.20tuples.html#211993161">(Oct 02 2020 at 00:41)</a>:</h4>
<p>I'm not entirely sure</p>
<p>From what I understand constituent types returns a list of types, which in case for closures looks something like:</p>
<ul>
<li>Pre capture analysis: vector containing a single inference variable</li>
<li>Post capture analysis: vector containing n elements T1, ..Tn where Ti is the type of the ith captured place. </li>
</ul>
<p>Are you suggesting that in the post analysis case we return vector containing 1 element - the tuple (T1, ..., Tn) ?</p>
<p>cc <span class="user-mention" data-user-id="307184">@rocksand</span></p>



<a name="211994586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/auto%20trait%20tuples/near/211994586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/auto.20trait.20tuples.html#211994586">(Oct 02 2020 at 01:10)</a>:</h4>
<p>If so I think we will have to work on figuring out how to hide some of the details in the output. <br>
<a href="https://github.com/sexxi-goose/rust/commit/f6acb32358ca2ae0b69915fed01ce8245add25c7">https://github.com/sexxi-goose/rust/commit/f6acb32358ca2ae0b69915fed01ce8245add25c7</a></p>
<p>The calls to shallow resolve can be removed but don't think it will change the test output</p>



<a name="212580675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/auto%20trait%20tuples/near/212580675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/auto.20trait.20tuples.html#212580675">(Oct 07 2020 at 16:02)</a>:</h4>
<p>I was thinking about this, and I think regardless of output we should do this, since the change to fix diagnostics (<a href="https://github.com/sexxi-goose/rust/pull/23/files#diff-4b0c915b012b616fb2269340b313ab75R1334-R1336">https://github.com/sexxi-goose/rust/pull/23/files#diff-4b0c915b012b616fb2269340b313ab75R1334-R1336</a>) ignores the first tuple we see</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>